﻿package mortal.game.scene3D.map3D.AstarAnyDirection.data
{
    import flash.geom.*;

    public class Vector2f extends Object
    {
        public var _x:Number;
        public var _y:Number;

        public function Vector2f(param1:Number = 0, param2:Number = 0)
        {
            this.x = param1;
            this.y = param2;
            return;
        }// end function

        public function set x(param1:Number) : void
        {
            this._x = param1;
            return;
        }// end function

        public function set y(param1:Number) : void
        {
            this._y = param1;
            return;
        }// end function

        public function fromPoint(param1:Point) : void
        {
            this._x = param1.x;
            this._y = param1.y;
            return;
        }// end function

        public function length() : Number
        {
            return Math.sqrt(this.lengthSquared());
        }// end function

        public function lengthSquared() : Number
        {
            return this._x * this._x + this._y * this._y;
        }// end function

        public function distanceSquared(param1:Vector2f) : Number
        {
            var _loc_2:* = this._x - param1._x;
            var _loc_3:* = this._y - param1._y;
            return Number(_loc_2 * _loc_2 + _loc_3 * _loc_3);
        }// end function

        public function negate() : Vector2f
        {
            return new Vector2f(-this._x, -this._y);
        }// end function

        public function addLocal(param1:Vector2f) : Vector2f
        {
            if (param1 == null)
            {
                return null;
            }
            this._x = this._x + param1._x;
            this._y = this._y + param1._y;
            return this;
        }// end function

        public function subtract(param1:Vector2f, param2:Vector2f) : void
        {
            param2._x = this._x - param1._x;
            param2._y = this._y - param1._y;
            return;
        }// end function

        public function dot(param1:Vector2f) : Number
        {
            if (param1 == null)
            {
                return 0;
            }
            return this._x * param1._x + this._y * param1._y;
        }// end function

        public function crossMult(param1:Vector2f) : Number
        {
            return this._x * param1._y - this._y * param1._x;
        }// end function

    }
}
